package com.ruoyi.pyo.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.pyo.mapper.PetYeahWechatUserMapper;
import com.ruoyi.pyo.domain.PetYeahWechatUser;
import com.ruoyi.pyo.service.IPetYeahWechatUserService;

/**
 * 用户Service业务层处理
 *
 * @author ruoyi
 * @date 2025-11-19
 */
@Service
public class PetYeahWechatUserServiceImpl extends ServiceImpl<PetYeahWechatUserMapper, PetYeahWechatUser> implements IPetYeahWechatUserService {
    @Autowired
    private PetYeahWechatUserMapper petYeahWechatUserMapper;

    /**
     * 查询用户
     *
     * @param id 用户主键
     * @return 用户
     */
    @Override
    public PetYeahWechatUser selectPetYeahWechatUserById(Long id) {
        return petYeahWechatUserMapper.selectPetYeahWechatUserById(id);
    }

    /**
     * 查询用户列表
     *
     * @param petYeahWechatUser 用户
     * @return 用户
     */
    @Override
    public List<PetYeahWechatUser> selectPetYeahWechatUserList(PetYeahWechatUser petYeahWechatUser) {
        return petYeahWechatUserMapper.selectPetYeahWechatUserList(petYeahWechatUser);
    }

    /**
     * 新增用户
     *
     * @param petYeahWechatUser 用户
     * @return 结果
     */
    @Override
    public int insertPetYeahWechatUser(PetYeahWechatUser petYeahWechatUser) {
        petYeahWechatUser.setCreateTime(DateUtils.getNowDate());
        return petYeahWechatUserMapper.insertPetYeahWechatUser(petYeahWechatUser);
    }

    /**
     * 修改用户
     *
     * @param petYeahWechatUser 用户
     * @return 结果
     */
    @Override
    public int updatePetYeahWechatUser(PetYeahWechatUser petYeahWechatUser) {
        petYeahWechatUser.setUpdateTime(DateUtils.getNowDate());
        return petYeahWechatUserMapper.updatePetYeahWechatUser(petYeahWechatUser);
    }

    /**
     * 批量删除用户
     *
     * @param ids 需要删除的用户主键
     * @return 结果
     */
    @Override
    public int deletePetYeahWechatUserByIds(Long[] ids) {
        return petYeahWechatUserMapper.deletePetYeahWechatUserByIds(ids);
    }

    /**
     * 删除用户信息
     *
     * @param id 用户主键
     * @return 结果
     */
    @Override
    public int deletePetYeahWechatUserById(Long id) {
        return petYeahWechatUserMapper.deletePetYeahWechatUserById(id);
    }
}
